﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Service.BusinessLayer.Entities;
using Service.DataAccess.DataAccessHelper;
using System.Data.SqlClient;
using System.Data;

namespace Service.DataAccess.DataAccessLogic
{
    class ChiPhi_DA
    {
        public void them(ChiPhi cp)
        {
            Helper help = new Helper();
            SqlParameter[] par = new SqlParameter[2];
            par[0] = new SqlParameter("@macp", cp.Macp);
            par[1] = new SqlParameter("@tencp", cp.Tencp);
            help.InsertQuery("sp_chiphi_them", par);
        }
        public void sua(ChiPhi cp)
        {
            Helper help = new Helper();
            SqlParameter[] par = new SqlParameter[2];
            par[0] = new SqlParameter("@macp", cp.Macp);
            par[1] = new SqlParameter("@tencp", cp.Tencp);
            help.UpdateQuery("sp_chiphi_sua", par);
        }
        public void xoa(string macp)
        {
            Helper help = new Helper();
            SqlParameter[] par = new SqlParameter[1];
            par[0] = new SqlParameter("@macp", macp);
            help.DeleteQuery("sp_chiphi_xoa", par);
        }
        public DataSet layds()
        {
            Helper help = new Helper();
            DataSet ds = help.SelectQuery("sp_chiphi_layds");
            return ds;
        }
    }
}
